/**
 *<p>Copyright: Copyright (c) 2012</p> 
 *<p>Company: SCPII</p>
 *<p>Project:scpii-api</p>
 *@author xiezhouyan
 *@Date 2013-2-1 下午3:40:13
 *@version 1.0
 *@description:
 */
package com.scpii.api.common.base;

public class ResponseThreadlocal {
	private static ThreadLocal<Response> responseThreadLocal = new ThreadLocal<Response>();

	public static void setResponse(Response response) {
		responseThreadLocal.set(response);
	}

	public static Response getResponse() {
		Response response = responseThreadLocal.get();
		if (response == null) {
			response = new Response();
			responseThreadLocal.set(response);
		}
		return response;
	}

	public static void removeResponse() {
		responseThreadLocal.remove();
	}
}
